package lev01_beginnerClass.class07_linkedLIst;

public class L01_ReverseSingleLinkedList {
    public static void main(String[] args) {

    }

    public static Node reverseSingleLinkedList(Node head){
        if(head == null){
            return null;
        }
        Node pre = null;
        Node next = null;
        while(head != null){
            next = head.next;
            head.next = pre;
            pre = head;
            head = next;
        }
        return pre;
    }

    public class Node{
        private int value;
//        private Node pre;
        private Node next;
    }

}
